package model

import (
	"newRetailByGolang/variable"
	"time"
)

type TaskRecord struct {
	Id int64
	UserId int64
	RegistrationActivitieId int64
	UpgradeRecordId int64
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (taskRecord *TaskRecord) InsertTaskRecord(tr *TaskRecord) {
	variable.Db.Create(tr)

}

func (taskRecord *TaskRecord) FindTaskRecord(UserId int64, RegistrationActivitieId int64, UpgradeRecordId int64) *TaskRecord {
	var tr *TaskRecord
	variable.Db.Where("user_id = ? and registration_activitie_id = ? and upgrade_record_id = ?", UserId, RegistrationActivitieId, UpgradeRecordId).First(tr)
	return tr
}
